home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / pipe.z / pipe
Encoding:
Text File  |  2002-10-03  |  6.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ppppiiiippppeeee((((2222))))                                                                ppppiiiippppeeee((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _pppp_iiii_pppp_eeee - create an interprocess channel
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  13.  
  14.      _iiii_nnnn_tttt _pppp_iiii_pppp_eeee_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_[[[[_2222_]]]]_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _pppp_iiii_pppp_eeee creates an I/O mechanism called a pipe and returns two file
  18.      descriptors, _f_i_l_d_e_s_[[[[_0000_]]]] and _f_i_l_d_e_s_[[[[_1111_]]]].  IRIX has two distinct versions of
  19.      pipe: the SVR4 version and the SVR3.2 version.  The SVR3.2 version is
  20.      faster, and is generally preferred unless STREAMS semantics are required
  21.      for a specific reason.
  22.  
  23.      The SVR4 version of _pppp_iiii_pppp_eeee returns two STREAMS-based file descriptors which
  24.      are both opened for reading and writing.  The _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK
  25.      flags are cleared.  A read from _f_i_l_d_e_s_[[[[_0000_]]]] accesses the data written to
  26.      _f_i_l_d_e_s_[[[[_1111_]]]] on a first-in-first-out (FIFO) basis and a read from _f_i_l_d_e_s_[[[[_1111_]]]]
  27.      accesses the data written to _f_i_l_d_e_s_[[[[_0000_]]]] also on a FIFO basis.  The
  28.      _FFFF_DDDD______CCCC_LLLL_OOOO_EEEE_XXXX_EEEE_CCCC flag will be clear on both file descriptors.
  29.  
  30.      The SVR3.2 version of _pppp_iiii_pppp_eeee returns two non-STREAMS-based file
  31.      descriptors.  _F_i_l_d_e_s[0] is opened for reading and _f_i_l_d_e_s[1] is opened for
  32.      writing.  Up to PPPPIIIIPPPPEEEE____BBBBUUUUFFFF (defined in lllliiiimmmmiiiittttssss....hhhh) bytes of data are buffered
  33.      by the pipe before the writing process is blocked and guaranteed to be
  34.      written atomically.  The _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK flags are cleared.  A
  35.      read only file descriptor _f_i_l_d_e_s[0] accesses the data written to
  36.      _f_i_l_d_e_s[1] on a first-in-first-out (FIFO) basis.
  37.  
  38.      Upon successful completion _pppp_iiii_pppp_eeee marks for update the _ssss_tttt______aaaa_tttt_iiii_mmmm_eeee_,,,, _ssss_tttt______cccc_tttt_iiii_mmmm_eeee,
  39.      and _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee fields of the pipe.
  40.  
  41.      To use the SVR4 version of _pppp_iiii_pppp_eeee one must normally tune the system tunable
  42.      variable _ssss_vvvv_rrrr_3333_pppp_iiii_pppp_eeee to 0 (see _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee(1M)).  Otherwise, the SVR3.2 version
  43.      of _pppp_iiii_pppp_eeee is used, with the exception of applications linked against
  44.      lllliiiibbbbnnnnssssllll....ssssoooo (----llllnnnnssssllll), which normally get SVR4-style pipes by default.  This
  45.      can be disabled by setting the environment variable ____LLLLIIIIBBBBNNNNSSSSLLLL____UUUUSSSSEEEE____SSSSVVVVRRRR3333____PPPPIIIIPPPPEEEE
  46.      to 1111.  In this case such applications will get SVR3.2-styl pipe
  47.      semantics.
  48.  
  49.      _pppp_iiii_pppp_eeee fails if:
  50.  
  51.      _EEEE_MMMM_FFFF_IIII_LLLL_EEEE         The maximum number of file descriptors are currently open.
  52.  
  53.      _EEEE_NNNN_FFFF_IIII_LLLL_EEEE         A file table entry could not be allocated.
  54.  
  55. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  56.      _ssss_hhhh(1), _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee(1M), _ffff_cccc_nnnn_tttt_llll(2), _gggg_eeee_tttt_mmmm_ssss_gggg(2), _iiii_nnnn_tttt_rrrr_oooo(3N), _pppp_oooo_llll_llll(2), _pppp_uuuu_tttt_mmmm_ssss_gggg(2),
  57.      _rrrr_eeee_aaaa_dddd(2), _wwww_rrrr_iiii_tttt_eeee(2), _pppp_oooo_pppp_eeee_nnnn(3S), _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7)
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ppppiiiippppeeee((((2222))))                                                                ppppiiiippppeeee((((2222))))
  71.  
  72.  
  73.  
  74. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  75.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  76.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  77.  
  78. NNNNOOOOTTTTEEEESSSS
  79.      Since a SVR4 version of pipe is bi-directional, there are two separate
  80.      flows of data.  Therefore, the size (_ssss_tttt______ssss_iiii_zzzz_eeee) returned by a call to
  81.      _ffff_ssss_tttt_aaaa_tttt(2) with argument _f_i_l_d_e_s_[[[[_0000_]]]] or _f_i_l_d_e_s_[[[[_1111_]]]] is the number of bytes
  82.      available for reading from _f_i_l_d_e_s_[[[[_0000_]]]] or _f_i_l_d_e_s_[[[[_1111_]]]] respectively.
  83.      Previously, the size (_ssss_tttt______ssss_iiii_zzzz_eeee) returned by a call to _ffff_ssss_tttt_aaaa_tttt() with
  84.      argument _f_i_l_d_e_s_[[[[_1111_]]]] (the write-end) was the number of bytes available for
  85.      reading from _f_i_l_d_e_s_[[[[_0000_]]]] (the read-end).
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.